#include "settings/qls_settings.h"

#include <QDir>
#include <QCoreApplication>

QLsSettings::QLsSettings()
{
}

void QLsSettings::setWorkSpace(const QString &ws)
{
    QDir dir(ws);
    if (not dir.exists()) {
        dir.mkdir(ws);
    }

    // 设置工作目录
    QDir::setCurrent(ws);
}

QString QLsSettings::getWorkSpace()
{
    return QDir::currentPath();
}

QString QLsSettings::getInstallPath()
{
    return QDir::cleanPath(QCoreApplication::applicationDirPath() + "/../");
}
